package com.example.common.response;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@Slf4j
public class BizException extends RuntimeException implements CommonException{

    private int code;

    private String message;

    
    public BizException(CommonException exceptionEnum){

        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getMessage();
    }

    public BizException(int code, String message){
        this.code = code;
        this.message = message;
    }

    public BizException(int code){
        this.code = code;
        this.message = "未知错误";
    }

    public BizException(String message){
        this.code = 10001;
        this.message = message;
    }
}
